Skip to content

[A11y] Add Save button to Report settings single-select pages (Write capability, Notification preference, Visibility) - #94557

Merged
lakchote merged 12 commits into
mainfrom
claude-a11y-report-settings-save
Jul 28, 2026
Merged

[A11y] Add Save button to Report settings single-select pages (Write capability, Notification preference, Visibility)#94557
lakchote merged 12 commits into
mainfrom
claude-a11y-report-settings-save

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This is PR 1 of the batched rollout plan that extends the WCAG 3.2.2 ("On Input") fix from #92749 to the remaining single-select pages. It covers the three Report settings pages, grouped together because they live in the same directory and share the identical SelectionList + SingleSelectListItem pattern.

Before this change each page persisted the change and navigated away the instant a row was selected, which is the "change of context on input" that WCAG 3.2.2 prohibits — especially disruptive for screen-reader users. The fix mirrors #92749: the selection is held in local draft state (the page stays open, the checkmark moves), and the change is only persisted + the page closed when the user taps a Save button added via confirmButtonOptions.

Pages fixed:

  • DynamicWriteCapabilityPageonSelectRow now updates draft selectedWriteCapability; Save calls updateWriteCapability + goBack.
  • DynamicNotificationPreferencePageonSelectRow now updates draft selectedNotificationPreference; Save calls updateNotificationPreference + goBack.
  • DynamicVisibilityPage ⚠️ — same draft + Save pattern, but the Public confirmation modal is preserved: selecting Public just moves the checkmark, and the existing "Are you sure?" modal is now gated on Save (if the user cancels the modal, nothing is persisted and the page stays open).

No SelectionList component changes; behavior is identical on web and native; optimistic/offline behavior is unchanged.

Fixed Issues

$ #74834
PROPOSAL: #74834 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  1. Open a report → SettingsNotify me about new messages. Select a different option and verify the page does not close automatically; the checkmark moves to the selection. Tap Save and verify the preference is saved and the page closes. Re-open, change a selection, tap the back button without Save, and verify the original value is retained.
  2. Repeat for Who can post (write capability) on a report where you can edit it.
  3. For a room you own, open SettingsVisibility. Select Private/Restricted and verify the page stays open until Save. Select Public, tap Save, and verify the "Are you sure?" confirmation modal appears; confirm → visibility saves and page closes; cancel → nothing saved and page stays open.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests — selecting an option and tapping Save should optimistically apply the change while offline.

QA Steps

// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
      • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videosundefined

…button

Co-authored-by: truph01 <truph01@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team June 25, 2026 08:31
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...tings/Report/DynamicNotificationPreferencePage.tsx 0.00% <0.00%> (ø)
...ges/settings/Report/DynamicWriteCapabilityPage.tsx 0.00% <0.00%> (ø)
...rc/pages/settings/Report/DynamicVisibilityPage.tsx 0.00% <0.00%> (ø)
... and 8 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I analyzed the failing checks. There's no code failure to fix — every code/CI check passes (typecheck, all 8 test jobs, ESLint, Prettier, Bun tests, Storybook, all builds, React Compiler, knip, spellcheck, codecov).

The single red check is PR Author Checklist / checklist, which failed with:

You completed 0 out of 41 checklist items with 41 unfinished items

This is the manual author checklist in the PR description — it can only be cleared by you checking the boxes (it's intentionally human-only, so I won't fill it out on your behalf). Once you complete the checklist, that check will pass and the PR will be green.

When I first looked, several test jobs and typecheck were still running; they have all since finished successfully, so no commit is needed.

@truph01

truph01 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review

@MelvinBot
MelvinBot marked this pull request as ready for review June 25, 2026 09:12
@MelvinBot
MelvinBot requested a review from a team as a code owner June 25, 2026 09:12
@melvin-bot
melvin-bot Bot requested review from flaviadefaria and truph01 and removed request for a team June 25, 2026 09:12
@melvin-bot

melvin-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

@truph01 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team June 25, 2026 09:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d85eb1a072

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/settings/Report/DynamicNotificationPreferencePage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicNotificationPreferencePage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicNotificationPreferencePage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicWriteCapabilityPage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicWriteCapabilityPage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicVisibilityPage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicVisibilityPage.tsx Outdated
Comment thread src/pages/settings/Report/DynamicVisibilityPage.tsx Outdated
@truph01

truph01 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Check and resolve all comments above

…rop redundant React Compiler memoization

Co-authored-by: truph01 <truph01@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner June 25, 2026 09:39
@melvin-bot
melvin-bot Bot requested review from lakchote and removed request for a team June 25, 2026 09:39
@melvin-bot

melvin-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

@lakchote Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const isMoneyRequest = isMoneyRequestReport(report);
const currentNotificationPreference = getReportNotificationPreference(report);
// Keep the draft undefined until the user picks a row so we always fall back to the live preference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put an empty line before the comment unless it’s on the first line of a block.

Suggested change
// Keep the draft undefined until the user picks a row so we always fall back to the live preference.
// Keep the draft undefined until the user picks a row so we always fall back to the live preference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0f72407 — added the blank line before the comment.

return;
}
updateRoomVisibility(report.reportID, report.visibility, newVisibility);
// Selecting Public is a sensitive change, so it still has to be confirmed before we persist it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Selecting Public is a sensitive change, so it still has to be confirmed before we persist it.
// Selecting Public is a sensitive change, so it still has to be confirmed before we persist it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0f72407 — added the blank line before the comment.

@truph01

truph01 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Resolve the above comments

@melvin-bot
melvin-bot Bot requested a review from lakchote July 27, 2026 02:49
@truph01

truph01 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

The Jest Unit Tests / test (job 4) (pull_request) isn't related to this PR.

@lakchote lakchote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lakchote lakchote self-assigned this Jul 27, 2026
@lakchote

Copy link
Copy Markdown
Contributor

@MelvinBot merge latest main here

…ttings-save

Co-authored-by: Lucien Akchoté <lakchote@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Merged the latest main into this branch in d347e01 and pushed. It was a clean merge with no conflicts (the branch was 201 commits behind main), and the PR's changes are intact.

@lakchote lakchote assigned lakchote and unassigned lakchote Jul 27, 2026
@lakchote

Copy link
Copy Markdown
Contributor

@MelvinBot merge latest main here

…ttings-save

Co-authored-by: Lucien Akchoté <lakchote@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Merged latest main into the branch in bae8c56 (via git merge, no rebase/force-push). The merge was clean — no conflicts, and none of the three changed Report settings pages were touched by incoming commits, so this PR's changes are intact. Pushed to claude-a11y-report-settings-save.

@lakchote lakchote removed their assignment Jul 27, 2026
@truph01

truph01 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@lakchote All good now

@lakchote
lakchote merged commit 29d6dc5 into main Jul 28, 2026
41 checks passed
@lakchote
lakchote deleted the claude-a11y-report-settings-save branch July 28, 2026 14:52
@github-actions

Copy link
Copy Markdown
Contributor

🚧 lakchote has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.46-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site review — docs update required ✅

This PR adds a Save button to the three Report/room settings single-select pages (Who can post, Notify me about new messages, Visibility), changing the flow from "select → instantly save & close" to "select → tap Save to apply." That behavior change is reflected in one help article.

Draft docs PR: #97380

What I updated:

Why nothing else changed
  • The room creation flow (Create-a-New-Chat.md) uses a separate multi-field form with its own Create Room button (NewRoomPage) and is not affected by this PR — its "Who Can Post" / "Visibility" selections were never save-on-select.
  • No existing help article documents the step-by-step edit flow for a room's Visibility or a report's Notify me about new messages preference, so there was nothing to update for those two pages.
  • Labels verified against the live UI: section is Who can post, option is Admins only, button is Save.

@truph01, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #97415 was identified to be related to this PR.

@izarutskaya

Copy link
Copy Markdown

@truph01 Probably this is accessibility PR. Could this be verified by A11y team? Thank you in advance

@truph01

truph01 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@truph01 Probably this is accessibility PR. Could this be verified by A11y team? Thank you in advance

@rushatgabhane Could you ask A11y team to verify the PRs?

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants